In computer science, a loop is a sequence of statements which is specified once but which can be carried out several times in succession. Source code “inside” (or embedded in) the loop (the body of the loop) is executed a specified number of times, once for each of a collection of items, until some condition is met (or indefinitely where the condition is never stratified). In most computer programming languages, a while-loop (also known as a while loop) is a control flow statement that allows code to be executed repeatedly based on a given Boolean condition. The while-loop can be thought of as a repeating if statement. A for-loop (or simply a for loop) is a control flow statement for specifying iteration, which allows code to be executed repeatedly. Unlike other kinds of loops, such as the while-loop, the for-loop is often distinguished by an explicit loop counter or loop variable. This allows the body of the for-loop (the code that is being repeatedly executed) to know about the sequencing of each iteration. For-loops are also typically employed when the number of iterations is known before entering the loop. For-loops are a shorthand way to make loops when the number of iterations is known, as nearly every for-loop could alternatively be written as a while-loop. Another type of loop, known as a do-while-loop (or simply a do while loop) is a while-loop that executes a block of code (the body of the do-while-loop) at least once and then repeatedly executes the block, or not depending on a Boolean condition at the end of the block.
A compiler directive, also known as a directive pragma (from “pragmatic”) is a language construct that specifies how a compiler should process input. Compiler directives are not part of the grammar of a programming language, and may vary from compiler to compiler. In at least one example, a compiler directive is processed by a preprocessor to specify compiler behavior, or function as a form of in-band parameterization. In some examples, compiler directives specify global behavior, while in other cases a directive only affects a local section, such as a block of programming code. In some examples, compiler directives are optional compiler hints, and may be ignored. In other examples, a compiler directive is prescriptive, and must be followed by the compiler. However, a compiler directive does not perform any action in the source code itself, but rather changes a behavior of the compiler.